﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.EnterpriseLibrary.PolicyInjection;

using NCS.IConnect.ApplicationContexts;

using JM.JCY.BusinessFacade;
using JM.JCY.Common;
using JM.JCY.BusinessEntity;

namespace JM.JCY.Proxy
{
    public class AnnounceProxy : JCYProxyBase<IAnnounce>, IAnnounce
    {
        private IAnnounce GetInstance()
        {
            return PolicyInjection.Create<AnnounceBF, IAnnounce>();
        }

        public void UpdateAnnounce(AnnounceDataSet ds)
        {
            this.GetInstance().UpdateAnnounce(ds);
        }

        public void UpdateAnnouceSingle(AnnounceDataSet.T_AnnounceDataTable dt)
        {
            this.GetInstance().UpdateAnnouceSingle(dt);
        }

        public void UpdateAnnounceReceiverSingle(AnnounceDataSet.T_Announce_ReceiverDataTable dt)
        {
            this.GetInstance().UpdateAnnounceReceiverSingle(dt);
        }


        public AnnounceDataSet.T_Announce_ReceiverDataTable GetAnnounceReceiverById(int announceId)
        {

            return this.GetInstance().GetAnnounceReceiverById(announceId);
        }

        public AnnounceDataSet.T_Announce_SearchDataTable SearchAnnounce(string subject, string status, string readStatus, DateTime? startDate, DateTime? endDate)
        {
            return this.GetInstance().SearchAnnounce(subject, status, readStatus, startDate, endDate);
        }

        public AnnounceDataSet.T_AnnounceDataTable GetAnnounce(int announceId, string subject, string status)
        {

            return this.GetInstance().GetAnnounce(announceId, subject, status);
        }

        public AnnounceDataSet.T_Announce_Search_By_UserDataTable SearchAnnounceByUser(string subject, DateTime? startDate, DateTime? endDate, int currentUserId)
        {
            return this.GetInstance().SearchAnnounceByUser(subject, startDate, endDate, currentUserId);
        }

        public AnnounceDataSet.T_AnnounceDataTable SearchAnnouncForHome(int count, int receiverId)
        {
            return this.GetInstance().SearchAnnouncForHome(count, receiverId);
        }

        public void UpdateAnnounceStatus(int annId, string userName)
        {
            this.GetInstance().UpdateAnnounceStatus(annId, userName);
        }
    }
}
